{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "█\r"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "sys.path.append('..')\n",
    "from settings import DBSelector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "DB = DBSelector()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "engine = DB.get_engine('db_stock','qq')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "kzz_df  = pd.read_sql('tb_bond_jisilu',engine)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>可转债代码</th>\n",
       "      <th>可转债名称</th>\n",
       "      <th>可转债价格</th>\n",
       "      <th>正股名称</th>\n",
       "      <th>正股代码</th>\n",
       "      <th>正股现价</th>\n",
       "      <th>正股涨跌幅</th>\n",
       "      <th>最新转股价</th>\n",
       "      <th>溢价率</th>\n",
       "      <th>可转债涨幅</th>\n",
       "      <th>...</th>\n",
       "      <th>评级</th>\n",
       "      <th>下修提示</th>\n",
       "      <th>下调次数</th>\n",
       "      <th>转债剩余占总市值比</th>\n",
       "      <th>剩余规模</th>\n",
       "      <th>发行规模</th>\n",
       "      <th>股东配售率</th>\n",
       "      <th>强赎标志</th>\n",
       "      <th>强赎日期</th>\n",
       "      <th>更新日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>113035</td>\n",
       "      <td>福莱转债</td>\n",
       "      <td>244.00</td>\n",
       "      <td>福莱特</td>\n",
       "      <td>601865</td>\n",
       "      <td>37.20</td>\n",
       "      <td>-0.21</td>\n",
       "      <td>13.48</td>\n",
       "      <td>-11.58</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>...</td>\n",
       "      <td>AA</td>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>14.500</td>\n",
       "      <td>14.500</td>\n",
       "      <td>92.910</td>\n",
       "      <td>X</td>\n",
       "      <td>None</td>\n",
       "      <td>2020-11-11 15:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>113585</td>\n",
       "      <td>寿仙转债</td>\n",
       "      <td>150.39</td>\n",
       "      <td>寿仙谷</td>\n",
       "      <td>603896</td>\n",
       "      <td>45.73</td>\n",
       "      <td>0.22</td>\n",
       "      <td>28.68</td>\n",
       "      <td>-5.68</td>\n",
       "      <td>0.18</td>\n",
       "      <td>...</td>\n",
       "      <td>AA-</td>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td>5.5</td>\n",
       "      <td>3.600</td>\n",
       "      <td>3.600</td>\n",
       "      <td>82.309</td>\n",
       "      <td>X</td>\n",
       "      <td>None</td>\n",
       "      <td>2020-11-11 15:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>113586</td>\n",
       "      <td>上机转债</td>\n",
       "      <td>215.20</td>\n",
       "      <td>上机数控</td>\n",
       "      <td>603185</td>\n",
       "      <td>74.58</td>\n",
       "      <td>-1.28</td>\n",
       "      <td>33.30</td>\n",
       "      <td>-3.91</td>\n",
       "      <td>-1.45</td>\n",
       "      <td>...</td>\n",
       "      <td>AA-</td>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td>3.8</td>\n",
       "      <td>6.650</td>\n",
       "      <td>6.650</td>\n",
       "      <td>85.553</td>\n",
       "      <td>X</td>\n",
       "      <td>None</td>\n",
       "      <td>2020-11-11 15:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>128115</td>\n",
       "      <td>巨星转债</td>\n",
       "      <td>206.80</td>\n",
       "      <td>巨星科技</td>\n",
       "      <td>002444</td>\n",
       "      <td>26.37</td>\n",
       "      <td>0.42</td>\n",
       "      <td>12.28</td>\n",
       "      <td>-3.70</td>\n",
       "      <td>3.34</td>\n",
       "      <td>...</td>\n",
       "      <td>AA</td>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td>3.4</td>\n",
       "      <td>9.730</td>\n",
       "      <td>9.730</td>\n",
       "      <td>74.920</td>\n",
       "      <td>X</td>\n",
       "      <td>None</td>\n",
       "      <td>2020-11-11 15:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>123052</td>\n",
       "      <td>飞鹿转债</td>\n",
       "      <td>137.80</td>\n",
       "      <td>飞鹿股份</td>\n",
       "      <td>300665</td>\n",
       "      <td>14.10</td>\n",
       "      <td>-4.28</td>\n",
       "      <td>9.90</td>\n",
       "      <td>-3.24</td>\n",
       "      <td>-3.70</td>\n",
       "      <td>...</td>\n",
       "      <td>A+</td>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td>10.3</td>\n",
       "      <td>1.770</td>\n",
       "      <td>1.770</td>\n",
       "      <td>75.366</td>\n",
       "      <td>X</td>\n",
       "      <td>None</td>\n",
       "      <td>2020-11-11 15:03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 27 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    可转债代码 可转债名称   可转债价格  正股名称    正股代码   正股现价  正股涨跌幅  最新转股价    溢价率  可转债涨幅  ...  \\\n",
       "0  113035  福莱转债  244.00   福莱特  601865  37.20  -0.21  13.48 -11.58  -0.10  ...   \n",
       "1  113585  寿仙转债  150.39   寿仙谷  603896  45.73   0.22  28.68  -5.68   0.18  ...   \n",
       "2  113586  上机转债  215.20  上机数控  603185  74.58  -1.28  33.30  -3.91  -1.45  ...   \n",
       "3  128115  巨星转债  206.80  巨星科技  002444  26.37   0.42  12.28  -3.70   3.34  ...   \n",
       "4  123052  飞鹿转债  137.80  飞鹿股份  300665  14.10  -4.28   9.90  -3.24  -3.70  ...   \n",
       "\n",
       "    评级 下修提示 下调次数  转债剩余占总市值比    剩余规模    发行规模   股东配售率 强赎标志  强赎日期  \\\n",
       "0   AA         0        2.0  14.500  14.500  92.910    X  None   \n",
       "1  AA-         0        5.5   3.600   3.600  82.309    X  None   \n",
       "2  AA-         0        3.8   6.650   6.650  85.553    X  None   \n",
       "3   AA         0        3.4   9.730   9.730  74.920    X  None   \n",
       "4   A+         0       10.3   1.770   1.770  75.366    X  None   \n",
       "\n",
       "               更新日期  \n",
       "0  2020-11-11 15:03  \n",
       "1  2020-11-11 15:03  \n",
       "2  2020-11-11 15:03  \n",
       "3  2020-11-11 15:03  \n",
       "4  2020-11-11 15:03  \n",
       "\n",
       "[5 rows x 27 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kzz_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "basic_info_df = pd.read_sql('tb_basic_info',engine)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>code</th>\n",
       "      <th>name</th>\n",
       "      <th>industry</th>\n",
       "      <th>area</th>\n",
       "      <th>pe</th>\n",
       "      <th>outstanding</th>\n",
       "      <th>totals</th>\n",
       "      <th>totalAssets</th>\n",
       "      <th>liquidAssets</th>\n",
       "      <th>...</th>\n",
       "      <th>pb</th>\n",
       "      <th>timeToMarket</th>\n",
       "      <th>undp</th>\n",
       "      <th>perundp</th>\n",
       "      <th>rev</th>\n",
       "      <th>profit</th>\n",
       "      <th>gpr</th>\n",
       "      <th>npr</th>\n",
       "      <th>holders</th>\n",
       "      <th>更新日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>300903</td>\n",
       "      <td>N科翔</td>\n",
       "      <td>元器件</td>\n",
       "      <td>广东</td>\n",
       "      <td>96.70</td>\n",
       "      <td>0.41</td>\n",
       "      <td>1.72</td>\n",
       "      <td>15.67</td>\n",
       "      <td>11.53</td>\n",
       "      <td>...</td>\n",
       "      <td>8.90</td>\n",
       "      <td>20201105</td>\n",
       "      <td>2.19</td>\n",
       "      <td>1.27</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>22.12</td>\n",
       "      <td>6.96</td>\n",
       "      <td>47605.0</td>\n",
       "      <td>2020-11-06 18:10:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>300906</td>\n",
       "      <td>N日月明</td>\n",
       "      <td>专用机械</td>\n",
       "      <td>江西</td>\n",
       "      <td>159.78</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.80</td>\n",
       "      <td>3.70</td>\n",
       "      <td>3.02</td>\n",
       "      <td>...</td>\n",
       "      <td>6.68</td>\n",
       "      <td>20201105</td>\n",
       "      <td>1.31</td>\n",
       "      <td>1.63</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>58.40</td>\n",
       "      <td>38.84</td>\n",
       "      <td>40039.0</td>\n",
       "      <td>2020-11-06 18:10:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>300905</td>\n",
       "      <td>N宝丽迪</td>\n",
       "      <td>塑料</td>\n",
       "      <td>江苏</td>\n",
       "      <td>70.73</td>\n",
       "      <td>0.18</td>\n",
       "      <td>0.72</td>\n",
       "      <td>4.89</td>\n",
       "      <td>3.22</td>\n",
       "      <td>...</td>\n",
       "      <td>5.98</td>\n",
       "      <td>20201105</td>\n",
       "      <td>2.67</td>\n",
       "      <td>3.71</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>25.61</td>\n",
       "      <td>16.18</td>\n",
       "      <td>36007.0</td>\n",
       "      <td>2020-11-06 18:10:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>300141</td>\n",
       "      <td>和顺电气</td>\n",
       "      <td>电气设备</td>\n",
       "      <td>江苏</td>\n",
       "      <td>0.00</td>\n",
       "      <td>1.66</td>\n",
       "      <td>2.54</td>\n",
       "      <td>11.13</td>\n",
       "      <td>9.25</td>\n",
       "      <td>...</td>\n",
       "      <td>6.36</td>\n",
       "      <td>20101112</td>\n",
       "      <td>1.93</td>\n",
       "      <td>0.76</td>\n",
       "      <td>-48.86</td>\n",
       "      <td>-629.40</td>\n",
       "      <td>21.51</td>\n",
       "      <td>-6.02</td>\n",
       "      <td>15050.0</td>\n",
       "      <td>2020-11-06 18:10:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>300807</td>\n",
       "      <td>天迈科技</td>\n",
       "      <td>软件服务</td>\n",
       "      <td>河南</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.17</td>\n",
       "      <td>0.68</td>\n",
       "      <td>7.13</td>\n",
       "      <td>4.97</td>\n",
       "      <td>...</td>\n",
       "      <td>6.18</td>\n",
       "      <td>20191219</td>\n",
       "      <td>1.71</td>\n",
       "      <td>2.52</td>\n",
       "      <td>-57.52</td>\n",
       "      <td>-142.67</td>\n",
       "      <td>50.68</td>\n",
       "      <td>-13.14</td>\n",
       "      <td>10574.0</td>\n",
       "      <td>2020-11-06 18:10:03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   index    code  name industry area      pe  outstanding  totals  \\\n",
       "0      0  300903   N科翔      元器件   广东   96.70         0.41    1.72   \n",
       "1      1  300906  N日月明     专用机械   江西  159.78         0.20    0.80   \n",
       "2      2  300905  N宝丽迪       塑料   江苏   70.73         0.18    0.72   \n",
       "3      3  300141  和顺电气     电气设备   江苏    0.00         1.66    2.54   \n",
       "4      4  300807  天迈科技     软件服务   河南    0.00         0.17    0.68   \n",
       "\n",
       "   totalAssets  liquidAssets  ...    pb  timeToMarket  undp  perundp    rev  \\\n",
       "0        15.67         11.53  ...  8.90      20201105  2.19     1.27   0.00   \n",
       "1         3.70          3.02  ...  6.68      20201105  1.31     1.63   0.00   \n",
       "2         4.89          3.22  ...  5.98      20201105  2.67     3.71   0.00   \n",
       "3        11.13          9.25  ...  6.36      20101112  1.93     0.76 -48.86   \n",
       "4         7.13          4.97  ...  6.18      20191219  1.71     2.52 -57.52   \n",
       "\n",
       "   profit    gpr    npr  holders                更新日期  \n",
       "0    0.00  22.12   6.96  47605.0 2020-11-06 18:10:03  \n",
       "1    0.00  58.40  38.84  40039.0 2020-11-06 18:10:03  \n",
       "2    0.00  25.61  16.18  36007.0 2020-11-06 18:10:03  \n",
       "3 -629.40  21.51  -6.02  15050.0 2020-11-06 18:10:03  \n",
       "4 -142.67  50.68 -13.14  10574.0 2020-11-06 18:10:03  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "basic_info_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['广东', '江西', '江苏', '河南', '上海', '深圳', '浙江', '湖南', '吉林', '北京', '四川',\n",
       "       '山东', '重庆', '海南', '云南', '湖北', '福建', '西藏', '河北', '陕西', '黑龙江', '新疆',\n",
       "       '安徽', '贵州', '辽宁', '天津', '青海', '内蒙', '山西', '甘肃', '广西', '宁夏'],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "basic_info_df['area'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "32"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(basic_info_df['area'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "east_north = ['深圳']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "kzz_df = kzz_df[['可转债名称','正股名称','正股代码']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "basic_info_df = basic_info_df[['code','area','industry']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "outfile = pd.merge(kzz_df, basic_info_df, how='left', left_on='正股代码',right_on='code')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>可转债名称</th>\n",
       "      <th>正股名称</th>\n",
       "      <th>正股代码</th>\n",
       "      <th>code</th>\n",
       "      <th>area</th>\n",
       "      <th>industry</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>福莱转债</td>\n",
       "      <td>福莱特</td>\n",
       "      <td>601865</td>\n",
       "      <td>601865</td>\n",
       "      <td>浙江</td>\n",
       "      <td>玻璃</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>寿仙转债</td>\n",
       "      <td>寿仙谷</td>\n",
       "      <td>603896</td>\n",
       "      <td>603896</td>\n",
       "      <td>浙江</td>\n",
       "      <td>中成药</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>上机转债</td>\n",
       "      <td>上机数控</td>\n",
       "      <td>603185</td>\n",
       "      <td>603185</td>\n",
       "      <td>江苏</td>\n",
       "      <td>机床制造</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>巨星转债</td>\n",
       "      <td>巨星科技</td>\n",
       "      <td>002444</td>\n",
       "      <td>002444</td>\n",
       "      <td>浙江</td>\n",
       "      <td>轻工机械</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>飞鹿转债</td>\n",
       "      <td>飞鹿股份</td>\n",
       "      <td>300665</td>\n",
       "      <td>300665</td>\n",
       "      <td>湖南</td>\n",
       "      <td>染料涂料</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  可转债名称  正股名称    正股代码    code area industry\n",
       "0  福莱转债   福莱特  601865  601865   浙江       玻璃\n",
       "1  寿仙转债   寿仙谷  603896  603896   浙江      中成药\n",
       "2  上机转债  上机数控  603185  603185   江苏     机床制造\n",
       "3  巨星转债  巨星科技  002444  002444   浙江     轻工机械\n",
       "4  飞鹿转债  飞鹿股份  300665  300665   湖南     染料涂料"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "outfile.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "outfile=outfile[outfile['area'].isin(east_north)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>可转债名称</th>\n",
       "      <th>正股名称</th>\n",
       "      <th>正股代码</th>\n",
       "      <th>code</th>\n",
       "      <th>area</th>\n",
       "      <th>industry</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>今天转债</td>\n",
       "      <td>今天国际</td>\n",
       "      <td>300532</td>\n",
       "      <td>300532</td>\n",
       "      <td>深圳</td>\n",
       "      <td>软件服务</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>拓邦转债</td>\n",
       "      <td>拓邦股份</td>\n",
       "      <td>002139</td>\n",
       "      <td>002139</td>\n",
       "      <td>深圳</td>\n",
       "      <td>元器件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>裕同转债</td>\n",
       "      <td>裕同科技</td>\n",
       "      <td>002831</td>\n",
       "      <td>002831</td>\n",
       "      <td>深圳</td>\n",
       "      <td>广告包装</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>聚飞转债</td>\n",
       "      <td>聚飞光电</td>\n",
       "      <td>300303</td>\n",
       "      <td>300303</td>\n",
       "      <td>深圳</td>\n",
       "      <td>半导体</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>亚泰转债</td>\n",
       "      <td>郑中设计</td>\n",
       "      <td>002811</td>\n",
       "      <td>002811</td>\n",
       "      <td>深圳</td>\n",
       "      <td>装修装饰</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>联得转债</td>\n",
       "      <td>联得装备</td>\n",
       "      <td>300545</td>\n",
       "      <td>300545</td>\n",
       "      <td>深圳</td>\n",
       "      <td>专用机械</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>文科转债</td>\n",
       "      <td>文科园林</td>\n",
       "      <td>002775</td>\n",
       "      <td>002775</td>\n",
       "      <td>深圳</td>\n",
       "      <td>建筑工程</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>尚荣转债</td>\n",
       "      <td>尚荣医疗</td>\n",
       "      <td>002551</td>\n",
       "      <td>002551</td>\n",
       "      <td>深圳</td>\n",
       "      <td>医疗保健</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>欣旺转债</td>\n",
       "      <td>欣旺达</td>\n",
       "      <td>300207</td>\n",
       "      <td>300207</td>\n",
       "      <td>深圳</td>\n",
       "      <td>元器件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>洪涛转债</td>\n",
       "      <td>洪涛股份</td>\n",
       "      <td>002325</td>\n",
       "      <td>002325</td>\n",
       "      <td>深圳</td>\n",
       "      <td>装修装饰</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>中金转债</td>\n",
       "      <td>中金岭南</td>\n",
       "      <td>000060</td>\n",
       "      <td>000060</td>\n",
       "      <td>深圳</td>\n",
       "      <td>铅锌</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>凯中转债</td>\n",
       "      <td>凯中精密</td>\n",
       "      <td>002823</td>\n",
       "      <td>002823</td>\n",
       "      <td>深圳</td>\n",
       "      <td>机械基件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>铁汉转债</td>\n",
       "      <td>铁汉生态</td>\n",
       "      <td>300197</td>\n",
       "      <td>300197</td>\n",
       "      <td>深圳</td>\n",
       "      <td>环境保护</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>203</th>\n",
       "      <td>华阳转债</td>\n",
       "      <td>华阳国际</td>\n",
       "      <td>002949</td>\n",
       "      <td>002949</td>\n",
       "      <td>深圳</td>\n",
       "      <td>建筑工程</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>220</th>\n",
       "      <td>金农转债</td>\n",
       "      <td>金新农</td>\n",
       "      <td>002548</td>\n",
       "      <td>002548</td>\n",
       "      <td>深圳</td>\n",
       "      <td>饲料</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>226</th>\n",
       "      <td>新星转债</td>\n",
       "      <td>深圳新星</td>\n",
       "      <td>603978</td>\n",
       "      <td>603978</td>\n",
       "      <td>深圳</td>\n",
       "      <td>铝</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244</th>\n",
       "      <td>景20转债</td>\n",
       "      <td>景旺电子</td>\n",
       "      <td>603228</td>\n",
       "      <td>603228</td>\n",
       "      <td>深圳</td>\n",
       "      <td>元器件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>254</th>\n",
       "      <td>特发转2</td>\n",
       "      <td>特发信息</td>\n",
       "      <td>000070</td>\n",
       "      <td>000070</td>\n",
       "      <td>深圳</td>\n",
       "      <td>通信设备</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>257</th>\n",
       "      <td>崇达转2</td>\n",
       "      <td>崇达技术</td>\n",
       "      <td>002815</td>\n",
       "      <td>002815</td>\n",
       "      <td>深圳</td>\n",
       "      <td>元器件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>258</th>\n",
       "      <td>特发转债</td>\n",
       "      <td>特发信息</td>\n",
       "      <td>000070</td>\n",
       "      <td>000070</td>\n",
       "      <td>深圳</td>\n",
       "      <td>通信设备</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>267</th>\n",
       "      <td>兴森转债</td>\n",
       "      <td>兴森科技</td>\n",
       "      <td>002436</td>\n",
       "      <td>002436</td>\n",
       "      <td>深圳</td>\n",
       "      <td>元器件</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>271</th>\n",
       "      <td>大族转债</td>\n",
       "      <td>大族激光</td>\n",
       "      <td>002008</td>\n",
       "      <td>002008</td>\n",
       "      <td>深圳</td>\n",
       "      <td>电器仪表</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     可转债名称  正股名称    正股代码    code area industry\n",
       "12    今天转债  今天国际  300532  300532   深圳     软件服务\n",
       "33    拓邦转债  拓邦股份  002139  002139   深圳      元器件\n",
       "65    裕同转债  裕同科技  002831  002831   深圳     广告包装\n",
       "74    聚飞转债  聚飞光电  300303  300303   深圳      半导体\n",
       "89    亚泰转债  郑中设计  002811  002811   深圳     装修装饰\n",
       "91    联得转债  联得装备  300545  300545   深圳     专用机械\n",
       "100   文科转债  文科园林  002775  002775   深圳     建筑工程\n",
       "103   尚荣转债  尚荣医疗  002551  002551   深圳     医疗保健\n",
       "107   欣旺转债   欣旺达  300207  300207   深圳      元器件\n",
       "120   洪涛转债  洪涛股份  002325  002325   深圳     装修装饰\n",
       "172   中金转债  中金岭南  000060  000060   深圳       铅锌\n",
       "183   凯中转债  凯中精密  002823  002823   深圳     机械基件\n",
       "190   铁汉转债  铁汉生态  300197  300197   深圳     环境保护\n",
       "203   华阳转债  华阳国际  002949  002949   深圳     建筑工程\n",
       "220   金农转债   金新农  002548  002548   深圳       饲料\n",
       "226   新星转债  深圳新星  603978  603978   深圳        铝\n",
       "244  景20转债  景旺电子  603228  603228   深圳      元器件\n",
       "254   特发转2  特发信息  000070  000070   深圳     通信设备\n",
       "257   崇达转2  崇达技术  002815  002815   深圳      元器件\n",
       "258   特发转债  特发信息  000070  000070   深圳     通信设备\n",
       "267   兴森转债  兴森科技  002436  002436   深圳      元器件\n",
       "271   大族转债  大族激光  002008  002008   深圳     电器仪表"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "outfile"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
